/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Sik
 */
@Embeddable
public class TransporteurPK implements Serializable
{
    @Basic(optional = false)
    @Column(name = "idAdherent")
    private int idAdherent;
    @Basic(optional = false)
    @Column(name = "idDeplacement")
    private int idDeplacement;

    public TransporteurPK()
    {
    }

    public TransporteurPK(int idAdherent, int idDeplacement)
    {
        this.idAdherent = idAdherent;
        this.idDeplacement = idDeplacement;
    }

    public int getIdAdherent()
    {
        return idAdherent;
    }

    public void setIdAdherent(int idAdherent)
    {
        this.idAdherent = idAdherent;
    }

    public int getIdDeplacement()
    {
        return idDeplacement;
    }

    public void setIdDeplacement(int idDeplacement)
    {
        this.idDeplacement = idDeplacement;
    }

    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += (int) idAdherent;
        hash += (int) idDeplacement;
        return hash;
    }

    @Override
    public boolean equals(Object object)
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TransporteurPK))
        {
            return false;
        }
        TransporteurPK other = (TransporteurPK) object;
        if (this.idAdherent != other.idAdherent)
        {
            return false;
        }
        if (this.idDeplacement != other.idDeplacement)
        {
            return false;
        }
        return true;
    }

    @Override
    public String toString()
    {
        return "Model.TransporteurPK[ idAdherent=" + idAdherent + ", idDeplacement=" + idDeplacement + " ]";
    }
    
}
